package com.tobby.camel.camelinaction.chapter1;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;

public class FileCopierWithCamel {

	public static void main(String[] args) throws Exception {
		CamelContext context = new DefaultCamelContext();
		context.addRoutes(new RouteBuilder() {
			@Override
			public void configure() throws Exception {
				from("file:C:/Users/Linhu/Desktop/camelinaction-2.15.5/chapter1/file-copy/data/inbox?noop=true")
						.to("file:C:/Users/Linhu/Desktop/camelinaction-2.15.5/chapter1/file-copy/data/outbox");
			}
		});
		context.start();
		System.err.println("Server Started...");
		Thread.sleep(100000);
		context.stop();
	}
}
